package com.ktjiaotu.cglibdynamicproxy;

import net.sf.cglib.proxy.Enhancer;

/**
 * @Author: DABINGCHNEGJIAO
 * @CreateTime: 2025-06-05
 * @Description:
 * @Version: 1.0
 */
public class IntermediaryCgliProxyFatctory {
    private static IntermediaryMethodInterceptor instance = new IntermediaryMethodInterceptor();

    public static <T> T create(Class<T> clazz) {
        Enhancer enhancer = new Enhancer();
        enhancer.setCallback(instance);
        enhancer.setSuperclass(clazz);
        return (T) enhancer.create();
    }
}
